package com.member.shop.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.member.shop.domain.SysBizGoods;
import com.member.shop.domain.SysBizGoodsSku;

import java.util.List;

/**
 * 商品skuService接口
 *
 * @author lixinchen
 * @date 2024-01-05
 */
public interface ISysBizGoodsSkuService extends IService<SysBizGoodsSku> {
    /**
     * 查询商品sku
     *
     * @param id 商品sku主键
     * @return 商品sku
     */
    public SysBizGoodsSku selectSysBizGoodsSkuById(Long id);

    /**
     * 查询商品sku列表
     *
     * @param sysBizGoodsSku 商品sku
     * @return 商品sku集合
     */
    public List<SysBizGoodsSku> selectSysBizGoodsSkuList(LambdaQueryWrapper<SysBizGoodsSku> queryWrapper);

    /**
     * 新增商品sku
     *
     * @param sysBizGoodsSku 商品sku
     * @return 结果
     */
    public int insertSysBizGoodsSku(SysBizGoodsSku sysBizGoodsSku);

    /**
     * 修改商品sku
     *
     * @param sysBizGoodsSku 商品sku
     * @return 结果
     */
    public int updateSysBizGoodsSku(SysBizGoodsSku sysBizGoodsSku);

    /**
     * 批量删除商品sku
     *
     * @param ids 需要删除的商品sku主键集合
     * @return 结果
     */
    public int deleteSysBizGoodsSkuByIds(Long[] ids);

    /**
     * 删除商品sku信息
     *
     * @param id 商品sku主键
     * @return 结果
     */
    public int deleteSysBizGoodsSkuById(Long id);

    SysBizGoodsSku selectSysBizGoodsSkuByGoodsIdAndKey(Long goodsId, String skuCode);

    /**
     * 删除商品sku信息
     *
     * @param goodsId 商品主键
     * @return 结果
     */
    int deleteSysBizGoodsSkuByGoodsId(Long goodsId);

    int lockStocks(Long id, Long number);

    void releaseStocks(Long goodsId, String specsKey, Long number);

    List<SysBizGoodsSku> selectSkuList(SysBizGoods sysBizGoods);
}
